<?php
define('IN_ADMIN',True);
require_once('include/common.php');
require_once('include/func_inc.php');
require_once('include/public.sms.class.php');
if ( !$_USER->id ) {
	show_msg('你还没有登录，请先登录', 'login.php', 1000);
}
$OA_CONFIG_URL=explode('|',GET_INC_CONFIG_INFO(oaurl));
$OA_CONFIG_URL_VIEWS=$pahttp.$OA_CONFIG_URL[0];
$resads = Utility::HttpRequest($OA_CONFIG_URL_VIEWS.'/API/ads.php?user='.GET_INC_CONFIG_INFO(com_userid));
$rescopyright = Utility::HttpRequest($OA_CONFIG_URL_VIEWS.'/API/copyright.php?user='.GET_INC_CONFIG_INFO(com_userid).'&number='.GET_INC_CONFIG_INFO(com_number).'');
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><html>
<title>Office 515158 2011 OA办公系统</title>
   <link rel="stylesheet" type="text/css" href="themes01/default/index.css" />
   <link rel="stylesheet" type="text/css" href="themes01/default/tree.css" />
   <script type="text/javascript" src="javascripts01/jquery.min.js"></script>
   <script type="text/javascript" src="javascripts01/jquery-ui.custom.min.js"></script>
   <script type="text/javascript" src="javascripts01/jquery.ui.autocomplete.min.js"></script>
   <script type="text/javascript" src="javascripts01/jquery.effects.bounce.min.js"></script>
   <script type="text/javascript" src="javascripts01/jquery.plugins.js"></script>
   <script type="text/javascript" src="javascripts01/public.js"></script>
</head>
<script type="text/javascript"> 
//首页定义信息
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
self.focus();
var bTabStyle = true;
//初始化默认菜单
var menuExpand = "3";
//暂无用定义
var shortcutArray = Array();
//刷新时长
var monInterval = {online:120,sms:30};
//初始化自定义导航
var portalArray = [];
//一级数据
var adsurl = 'http://www.515158.com/API';
<?php
global $db;
$query = $db->query("SELECT * FROM ".DB_TABLEPRE."menu where menukey='1' and menutype='0' ORDER BY menunum Asc  ");
$portalArray='0';
while ($row = $db->fetch_array($query)) {
$portalArray=$portalArray.",".$row[menuid];
?>
portalArray["<?=$row[menuid]?>"] = {src:"<?=$row[menupic]?>", url:"<?=$row[menuurl]?>", title:"<?=$row[menuname]?>", closable:"true"};
<?php
}
?>
portalArray["0"] = {src:"0", url:"home.php", title:"个人桌面", closable:"true"};
//设定默认导航
var portalLoadArray = [<?=$portalArray;?>];
//参数
var func_array=[];
<?php 
//调用二级ID
function get_Amenu_list($fatherid=0)
{
	global $db;
	$query = $db->query("SELECT * FROM ".DB_TABLEPRE."menu where fatherid='$fatherid' and menutype='0' ORDER BY menunum Asc  ");
	while ($row = $db->fetch_array($query)) {
	echo 'func_array["f'.$row[menuid].'"]=["'.$row[menuname].'","'.$row[menuurl].'","'.$row[menuico].'"];';
	}

}

//一级数据
global $db;
$query = $db->query("SELECT * FROM ".DB_TABLEPRE."menu where fatherid='0' and menutype='0' ORDER BY menunum Asc   ");
$menustrdb='515158.com';
while ($row = $db->fetch_array($query)) {
$menustrdb=$menustrdb.",".$row[menuid];
?>
func_array["m<?=$row[menuid]?>"]=["<?=$row[menuname]?>","<?=$row[menuico]?>"];
<?php
get_Amenu_list($row['menuid']);
}
?>
//一级菜单
var first_array = [<?=str_replace("515158.com,","",$menustrdb)?>];
 
//二级菜单
var second_array = [];
<?php 
//过滤
$onemenustr=str_replace("515158.com,","",$menustrdb);
$onemenustrdb=explode(',',$onemenustr);
for($i=0;$i<sizeof($onemenustrdb);$i++)
{
global $db;
$query = $db->query("SELECT * FROM ".DB_TABLEPRE."menu where fatherid='".$onemenustrdb[$i]."' and menutype='0' ORDER BY menunum Asc  ");
$twomenustrdb='515158.com';
while ($row = $db->fetch_array($query)) {
$twomenustrdb=$twomenustrdb.",".$row[menuid];
}
?>
second_array["m<?=$onemenustrdb[$i]?>"] = [<?=str_replace("515158.com","",str_replace("515158.com,","",$twomenustrdb))?>];
<?php
}
?>
//与入在线人数
online_mon();
//-- 在线人员 --
function online_mon()
{
   jQuery.ajax({
      type: 'GET',
      url: 'home/user_count.php?date='+new Date(),
      success: function(data){
	  $('user_count').innerHTML = data;
      }
   });

   window.setTimeout(online_mon,monInterval.online*5*1000);
}
//消息提示,设定标题提示
var newSmsSoundHtml = "<object id='sms_sound' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='themes01/swf/swflash.cab' width='0' height='0'><param name='movie' value='themes01/swf/9.swf'><param name=quality value=high><embed id='sms_sound' src='themes01/swf/9.swf' width='0' height='0' quality='autohigh' wmode='opaque' type='application/x-shockwave-flash' plugspace='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></embed></object>";

sms_count();
function sms_count(type)
{
   jQuery.ajax({
      type: 'GET',
      url: 'home/sms_count.php?date='+new Date(),
      success: function(data){
	  	if(data=='1'){
	  		//jQuery('#shortcut').click();
	  		$('sms_count').innerHTML = '<img src="themes01/default/images/xin.gif">';
	  		$('sms_sound').innerHTML = newSmsSoundHtml;
	  	}else{
	 		 $('sms_count').innerHTML = '   ';
	  	}
      }
   });

   window.setTimeout(sms_count,monInterval.sms*5*1000);
}

</script>
<body>
   <div id="loading" class="loading" style="width:100%;height:100%;margin-top:100px;padding-top:100px;text-align:center;color:#1547b8;font-size:32px;font-family:微软雅黑,宋体;"></div>
   <div id="taskbar">
      <div id="taskbar_left">
         <a href="javascript:;" id="start_menu" hidefocus="hidefocus" title="开始"></a>
      </div>
      <div id="taskbar_center">
         <div id="tabs_left_scroll"></div>
         <div id="tabs_container"></div>
         <div id="tabs_right_scroll"></div>
      </div>
      <div id="taskbar_right">
      <script language="javascript"> 
function show_feedback()
{
   mytop=(screen.availHeight-430)/2;
   myleft=(screen.availWidth-600)/2;
   window.open("home/Message.php","","height=450,width=600,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
}
function show_userback()
{
   mytop=(screen.availHeight-370)/2;
   myleft=(screen.availWidth-312)/1;
   window.open("home/online.php","","height=490,width=300,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
}
//-- 免费版本广告 --
function StatusTextScroll()
{
   var obj = jQuery('#status_text');
   var scrollTo = obj.scrollTop() + obj.height();
   if(scrollTo >= obj.attr('scrollHeight'))
      scrollTo = 0;
   obj.animate({scrollTop: scrollTo}, 300);
}
window.setInterval(StatusTextScroll,2000);
</script>

         <span id="sms_count" class="sms_om"></span> 
         <a id="shortcut" href="javascript:;"  hidefocus="hidefocus" title="消息盒子"></a>
         <a id="portal" href="javascript:;" onClick="show_userback()" hidefocus="hidefocus" title="在线用户"></a>
		 <a id="person_info" href="javascript:;" onClick="show_feedback()" target="_parent" title="将问题提交给开发商进行解决"></a>
         <a id="logout" href="login.php?do=logout" hidefocus="hidefocus" title="注销登录"></a>
      </div>
   </div>
   
   
   <div id="funcbar">
      <div id="funcbar_left"></div>
      <div id="funcbar_right">

      </div>
   </div>
   
   
   <div id="center">

      <!-- OA精灵 -->
      <div id="shortcut_panel" class="over-mask-layer">
        <div class="left"></div> 
         <div class="center">
            <table width="700" style="margin-top:50px;margin-left:10px;" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="340">
				<!--<iframe name="tabs_sms_iframe" src="admin.php?ac=sms_receive&fileurl=sms" border="0" frameborder="0" framespacing="0" marginheight="0" marginwidth="0" style="width:100%;height:100%;"></iframe> -->
				<div id="shortcut_block"></div>
				
				</td>
              </tr>
            </table>
            
           <div class="bottom"></div> 
         </div>
        <div class="right"></div> 
         <div class="close">
            <a class="btn-black-a" href="javascript:;" onClick="jQuery('#shortcut').click();" hidefocus="hidefocus">关闭</a>
         </div>
      </div>
      
      <div id="overlay_panel"></div>
   </div>
   <div id="south">
      <table>
         <tr>
            <td class="left"><div onClick="show_userback()">共<span id="user_count" style="color:red; font-size:20px;"></span>人在线</div>			</td>
            
            <td class="center" id="copyrighttext"><?=$rescopyright?></td>           
            <td class="ads">
			<div id="status_text">
			<span id="adstext">
			<?=$resads?>
			</span>
			</div></td>
         </tr>
      </table>
   </div>
   
   <!-- 导航菜单 -->
   <div id="start_menu_panel">
      <div class="panel-head"></div>
      <!-- 登录用户信息 -->
      <div class="panel-user">
         <div class="avatar">
            <img src="themes01/default/images/0.gif" align="absmiddle" />
         </div>
         <div class="name"><?=GET_INC_USER_NAME($_USER->id)?></div>
         <div class="tools">
            <a class="exit" href="login.php?do=logout" hidefocus="hidefocus" title="退出"></a>
         </div>
      </div>
      <div class="panel-menu">
         <!-- 一级菜单 -->
         <div id="first_panel">
            <div class="scroll-up"></div>
            <ul id="first_menu"></ul>
            <div class="scroll-down"></div>
         </div>
         <!-- 二级菜单 -->
         <div id="second_panel">
            <div class="second-panel-head"></div>
            <div class="second-panel-menu"><ul id="second_menu"></ul></div>
            <div class="second-panel-foot"></div>
         </div>
      </div>
      <div class="panel-foot"></div>
   </div>
   <div id="overlay_startmenu"></div>
 
   <div id="sms_sound"></div>
   <div id="overlay"></div>
</body>
</html>